#
#
# @param A int整型一维数组
# @param target int整型
# @return int整型
#
class Solution:
    def search(self , A , target ):
        # write code here
        if target in A:
            return A.index(target)
        else:
            return -1

'''
二分查找
'''
#
#
# @param A int整型一维数组
# @param target int整型
# @return int整型
#
class Solution:
    def search(self , A , target ):
        # write code here
        if A==[]:
            return -1
        left = 0
        right = len(A)-1
        while(left<=right):
            mid = (right+left)//2
            if A[mid]==target:
                return mid
            if A[0] > A[mid]:
                if A[mid] < target < A[-1]:
                    left = mid+1
                else:
                    right = mid -1
            else:
                if A[0] < target < A[mid]:
                    right = mid - 1
                else:
                    left = mid +1
        return -1